﻿namespace UnityEditor.Controls.ProjectControl.ViewModel
{
    using System.Collections.ObjectModel;

    public sealed class TreeItemList : ObservableCollection<ProjectItem>
    {
        public TreeItemList()
        {
            // do nothing
        }

        public TreeItemList(ObservableCollection<ProjectItem> list)
            : base(list)
        {
        }

        protected override void InsertItem(int index, ProjectItem item)
        {
            if (ProjectItem.Filter.IsValidTreeItem(item) == false)
            {
                return;
            }
            base.InsertItem(index, item);
        }
    }
}
